package com.njupt.Collection;

import org.springframework.util.RouteMatcher;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * @author 2506165018
 * @version 1.0
 * @data 2025-07-29 16:22:37
 */
public class CreateStream {

    public static void main(String[] args) {
        Integer[] nums = {1,2,3,4,56,67};
        long count = Arrays.stream(nums).filter(item -> item > 10).count(); //2
        System.out.println(count);

        List<Integer> collect = Arrays.stream(nums).limit(2).collect(Collectors.toList());//[1, 2]
        System.out.println(collect);

        List<Integer> collect1 = Arrays.stream(nums).skip(2).collect(Collectors.toList());//[3, 4, 56, 67]
        System.out.println(collect1);


    }
}
